<script src="./js/jquery.js"></script>
<script type="text/javascript">
            $(function() {
                $("#prize li").each(function() {
                    var p = $(this);
                    var c = $(this).attr('class');
                    p.css("background-color", c);
                    p.click(function() {
                        $("#prize li").unbind('click'); //连续翻动
                        $.getJSON("get.php", function(json) {
                            var prize = json.yes; //抽中的奖项 
                            p.flip({
                                direction: 'rl', //翻动的方向rl：right to left 
                                content: prize, //翻转后显示的内容即奖品 
                                color: c, //背景色 
                                onEnd: function() { //翻转结束 
                                    p.css({"font-size": "22px", "line-height": "180px"});
                                    p.attr("id", "r"); //标记中奖方块的id 
                                    $("#viewother").show(); //显示查看其他按钮 
                                    $("#prize li").unbind('click').css("cursor", "default").removeAttr("title");
                                }
                            });
                            $("#data").data("nolist", json.no); //保存未中奖信息 
                        });
                    });
                });

                $("#viewother").click(function() {
                    var mydata = $("#data").data("nolist"); //获取数据 
                    var mydata2 = eval(mydata);//通过eval()函数可以将JSON转换成数组 

                    $("#prize li").not($('#r')[0]).each(function(index) {
                        var pr = $(this);
                        pr.flip({
                            direction: 'bt',
                            color: 'lightgrey',
                            content: mydata2[index], //奖品信息（未抽中） 
                            onEnd: function() {
                                pr.css({"font-size": "22px", "line-height": "180px", "color": "#333"});
                                $("#viewother").hide();$("#repeat").show();
                            }
                        });
                    });
                    $("#data").removeData("nolist");
                });
                $("#repeat").click(function() {
                    window.location.reload();
                });
            });
        </script>
<script src="./js/jquery-ui.js"></script>
<script src="./js/jquery.flip.min.js"></script>
<script src="./js/layer/layer.js"></script>
<script src="./js/address.js"></script>
<script src="./js/bxslider/bxslider.js"></script>
<link href="./js/bxslider/bxslider.css" rel="stylesheet" />
<script src="./js/script.js"></script>

<script>
function onlyNumber(o) {//限制输入数字
				var sValue = o.value;
				if (sValue == 0) {
					sValue = 1;
				}
				else {
					var aResult = [];
					var iLen = sValue.length;
					var sChar = "";
					for (var i = 0; i < iLen; i++) {
						sChar = sValue.charAt(i);
						if (sChar != " " && false == isNaN(sChar)) {
							aResult.push(sValue.charAt(i));
						}
					}
					sValue = aResult.join("") || 1;
				}
				o.value = sValue;				
				var Limit = <?php echo $limit?>;//$("#Limit").val()*1;
				if (sValue > Limit) {
					o.value = Limit || 1;
					$("#msg").text("商品热销仅剩<?php echo $limit?>件哦！");
				}
			}						
			function changeCount(o, n) {//加减值
				var Limit = <?php echo $limit?>;//库存$("#Limit").val();
				var oThis = $(o);
				var iValue = $.trim($(o).val()) * 1 + n;

				if (iValue > 0 && iValue <= Limit) {
					oThis.val(iValue);
				}
				else if (iValue <= 0) {
					oThis.val(1);
				}
				else {
					if (Limit <= 0) { oThis.val("1"); }
					else { oThis.val(Limit); }
					 $("#msg").text("商品热销仅剩<?php echo $limit?>件哦！");
				}
				return false;
			}			 
</script>

<script type="text/javascript">
	addressInit('cmbProvince', 'cmbCity', 'cmbArea', '<?php echo $sheng?>', '<?php echo $shi?>', '<?php echo $qu?>');
</script>

<?php mysql_close()?>			
